package com.example.pojo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class ResponseVo {

    private int code;

    private String msg;

    private Object data;

    private static Integer SUCCESS = 200;
    private static Integer FAIL = 50;

    public ResponseVo(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public static ResponseVo success(Object data) {
        return new  ResponseVo(SUCCESS,"success",data);
    }

    public static ResponseVo no(String msg) {
        return new  ResponseVo(FAIL,msg);
    }

}
